package com.fjnu.controller;

import java.util.Map;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fjnu.controller.common.BaseController;
import com.fjnu.entities.Administrator;
import com.fjnu.service.AdministratorService;
@Controller
@RequestMapping("/Administrator")
public class AdministratorController extends BaseController{
	private static Logger logger =LogManager.getLogger(AdministratorController.class);
	@Autowired
	private AdministratorService administratorServiceImpl;
	@RequestMapping(value="/register")
	@ResponseBody
	public Map<String,Object> register(Administrator administrator) {
		logger.info("注册管理员"+administrator.getPersonName());
		if(!init(administrator).get(STATUS).equals(SUCCESS))
			return getData2Result();
		administratorServiceImpl.addAdminService(administrator);
		return getData2Result();
	}
	
}
